home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1996 April / Macworld (1996-04).dmg / Shareware World / Entertainment / General / Xconq 7.0.1 / lib / postmodern.g < prev    next >
Text File  |  1995-08-22  |  26KB  |  754 lines

  1. (game-module "postmodern"
  2.   (blurb "An elaborated version of the standard game")
  3.   (variants
  4.    (world-seen false)
  5.    (see-all false)
  6.    )
  7.   )
  8.  
  9. ; possibly radar should get no moves - you have to embark it explicitly ?
  10. ; but then you can't disembark it.
  11.  
  12. ;(game-module (title "of surviving city-states struggling for control of the apocalypse's ruins..."))
  13.  
  14. (unit-type i (name "infantry") (char "i")
  15.   (help "marches around and captures things"))
  16. (unit-type a (name "armor") (char "a")
  17.   (help "faster than infantry, limited to open terrain"))
  18. (unit-type S (name "Special Forces") (char "S")
  19.   (help "special infiltration units"))
  20. (unit-type r (name "radar") (char "r")
  21.   (help "small device that sees far"))
  22. (unit-type A (name "airlifter") (char "A")
  23.   (help "big cargo plane, for moving supplies and troops"))
  24. (unit-type f (name "fighter") (char "f")
  25.   (help "interceptor to get those nasty Aircraft"))
  26. (unit-type b (name "bomber") (char "b")
  27.   (help "long range aircraft, carries infantry and bombs"))
  28. (unit-type d (name "destroyer") (char "d")
  29.   (help "fast, cheap, and sinks subs"))
  30. (unit-type s (name "submarine") (char "s")
  31.   (help "sneaks around and sinks ships"))
  32. (unit-type m (name "sea mines") (char "m")
  33.   (help "sea mine, floats around, sinks shps"))
  34. (unit-type t (name "transport ship") (char "t")
  35.   (help "carries units and supplies across the water"))
  36. (unit-type j (name "jeep") (char "j")
  37.   (help "trucks and jeeps for moving infantry and supplies"))
  38. (unit-type X (name "mech infantry") (char "X")
  39.   (help "infantry in powered armor and AFVs"))
  40. (unit-type C (name "carrier") (char "C")
  41.   (help "carries aircraft around"))
  42. (unit-type z (name "spy plane") (char "z")
  43.   (help "fast, hard to see spy craft"))
  44. (unit-type B (name "battleship") (char "B")
  45.   (help "the most powerful ship"))
  46. (unit-type G (name "missile") (char "G")
  47.   (help "powerful explosive, Very accurate"))
  48. (unit-type N (name "atomic") (char "N")
  49.   (help "nuclear fuel unit, or nuclear bomb"))
  50. (unit-type e (name "engineers") (char "e")
  51.   (help "produces things, fights sieges"))
  52. (unit-type O (name "bolo") (char "O")
  53.   (help "huge CyberTank - a veritable land battleship"))
  54. (unit-type L (name "land fortifications") (char "L")
  55.   (help "Hold those enemies at bay!"))
  56. (unit-type & (name "bridge") (char "&")
  57.   (help "serves as something units can walk over"))
  58. (unit-type / (name "base") (char "/")
  59.   (help "airstrip plus port"))
  60. (unit-type V (name "village") (char "V")
  61.   (help "small town"))
  62. (unit-type * (name "town") (char "*")
  63.   (help "smaller than a city"))
  64. (unit-type @ (name "city") (char "@")
  65.   (help "capital of a side"))
  66.  
  67. (material-type fuel (help "basic motive power"))
  68. (material-type ammo (help "generic hitting capability"))
  69. (material-type people (help "population, used to stock cities, operate units"))
  70.  
  71. (terrain-type sea (char ".") (color "sky blue"))
  72. (terrain-type shallows (char ",") (color "cyan"))
  73. (terrain-type swamp (char "=") (color "yellowgreen"))
  74. (terrain-type desert (char "~") (color "yellow"))
  75. (terrain-type plains (char "+") (color "green"))
  76. (terrain-type forest (char "%") (color "forest green"))
  77. (terrain-type mountains (char "^") (color "sienna"))
  78. (terrain-type ice (char "_") (color "white"))
  79. (terrain-type vacuum (char ":") (color "black"))
  80.  
  81. (add i image-name "man")
  82. (add a image-name "tank")
  83. (add S image-name "elite")
  84. (add r image-name "radar")
  85. (add A image-name "airlift")
  86. (add f image-name "jets")
  87. (add b image-name "bomber")
  88. (add d image-name "small-ship")
  89. (add s image-name "sub")
  90. (add m image-name "fortress")    ; hey, that icon makes a good mine!
  91. (add t image-name "cargo-ship")
  92. (add j image-name "jeep")
  93. (add X image-name "mech")
  94. (add C image-name "carrier")
  95. (add z image-name "spysat")
  96. (add B image-name "battleship")
  97. ;"engineer" e icon-name
  98. (add e image-name "tractor")
  99. (add G image-name "missile")
  100. (add N image-name "bomb")
  101. (add O image-name "ogre")
  102. (add L image-name "walltown")
  103. (add & image-name "bridge")
  104. (add / image-name "airbase")
  105. (add V image-name "village")
  106. (add * image-name "town20")
  107. (add @ image-name "city20")
  108.  
  109. (define bases ( L & / V * @ ))
  110. (define cities ( V * @ ))
  111. (define makers ( V * @ ))
  112. (define ground ( i a e S j X O ))
  113. (define aircraft ( A f b G z ))
  114. (define ships ( d s m t C B ))
  115. (define movers ( i a S r A f b d s m t j X C z B G N e O ))
  116. (define water ( sea shallows ))
  117. (define land ( plains forest desert mountains ))
  118.  
  119. ;;; Static relationships.
  120.  
  121. ;; Unit-unit.
  122.  
  123. (table unit-capacity-x
  124.   (u* r 1)    ; all units can have radar
  125.   (( S z ) r 0)    ; radar gives away their position - they use passive
  126.   (f G 4)
  127.   (d ( m G ) ( 8 2 ))
  128.   (X ( G N ) ( 20 1 ))
  129.   (G N 1)
  130.   )
  131.  
  132. (add u* capacity 0)
  133. (add i capacity 1)
  134. (add a capacity 1)
  135. (add S capacity 1)
  136. (add A capacity 4)
  137. (add b capacity 2)
  138. (add s capacity 2)
  139. (add t capacity 6)
  140. (add j capacity 3)
  141. (add C capacity 8)
  142. (add B capacity 1)
  143. (add O capacity 1)
  144. ;                     L  &  /  V  *  @ "bases"
  145. (add bases capacity ( 3  2  8 12 24 48 ))
  146.  
  147. (table unit-size-as-occupant
  148.   (u* u* 99)
  149.   (ground bases 1)
  150.   ;              d s m t C B "ships"
  151.   (ships bases ( 4 4 1 5 6 6 ))    ; ships are BIG!
  152.   ;                 A f b G z "aircraft"
  153.   (aircraft bases ( 2 1 2 1 1 ))
  154.   )
  155.  
  156. (table occupant-max add (i ( N G ) ( 1 2 )))
  157. ;FIXME capacity is N, upper limit on total occupants by size
  158. (table occupant-max add (a ( N G ) ( 1 2 )))
  159. (table occupant-max add (a ( i S ) 1))    ; small groups of troops can ride on armor!
  160. (table occupant-max add (S ( N G ) ( 1 2 )))
  161. (table occupant-max add (A ( i a S j X m O e ) ( 2 1 2 3 1 10 1 1 )))    ; heavy airlifter indeed
  162. (table occupant-max add (b ( i S m j N r G ) ( 1 1 6 1 2 1 4 )))
  163. (table occupant-max add (s ( S N G ) ( 1 2 4 )))
  164. (table occupant-max add (t ( i a S j X m O G e ) ( 6 3 8 8 3 12 1 6 2 )))
  165. (table occupant-max add (j ( i S X G e ) ( 3 3 2 3 1 )))
  166. (table occupant-max add (C ( f b m z G N ) ( 10 3 6 2 10 2 )))
  167. (table occupant-max add (B ( i S m G N ) 8))
  168. (table occupant-max add (G N 3))
  169. (table occupant-max add (O ( G N ) ( 6 3 )))
  170. (table occupant-max add (bases u* 40))
  171. (table occupant-max add (bases bases 0))
  172.  
  173. ;; Unit-terrain.
  174.  
  175. (add t* capacity 16)
  176.  
  177. (table unit-size-in-terrain
  178.   (u* t* 1)
  179.   (( * @ ) t* 12)
  180.   )
  181.  
  182. ;; Unit-material.
  183.  
  184. (table unit-storage-x
  185. ;                   L  &   /   V   *    @ "bases"
  186.   (bases fuel   ( 100 50 100 300 500  500 ))
  187.   (bases ammo   (  70 10  50  80 100  200 ))
  188.   (bases people (   2 1   20 200 400  999 ))
  189. ;                  i  a  S r  A  f  b  d  s m  t  j  X   C  z   B  G  N  e   O "movers"
  190.   (movers fuel   ( 6 10 20 2 40 18 36 99 99 5 99 50 30 400 48 200 20 10 30 180 ))
  191.   (movers ammo   ( 6 10 20 2 40 18 36 99 99 2 99 50 30 400 48 200 20 10 30  80 ))
  192.   (movers people ( 3  1  1 0  2  0  5  4  1 0 20 10  1   8  0   9  0  0 30   0 ))
  193.   )
  194.  
  195. ;;; Vision.
  196.  
  197. ;FIXME visibility is U T -> N, U's % visibility in T
  198. (table visibility add (( S m s z ) t* 0))
  199. (table visibility add (( G N ) t* 10))
  200.  
  201. (add ( V * @ ) see-always 1)
  202.  
  203. ;(add u* vision-at 1)
  204. ;(add aircraft vision-at 2)
  205. ;(add @ vision-at 3)
  206. ;(add * vision-at 2)
  207. ;(add r vision-at 6)
  208. ;(add z vision-at 4)
  209. ;(add m vision-at 0)
  210. ;(add ( C B ) vision-at 3)
  211.  
  212. ;FIXME vision-at is N, coverage afforded by unit in its own hex
  213. ;(add ( s z @ * C B ) vision-at-max-range 200)
  214.  
  215. ;FIXME vision-at-max-range is N, coverage afforded by unit at max range
  216. (add ( s z @ * C B ) vision-range 50)
  217.  
  218. ; small forces hidden by rough terrain
  219. ;FIXME conceal is now visibility, you should subtr these numbers from that table
  220. ;FIXME 60 forest ( i X j ) conceal
  221. ;FIXME 70  swamp ( i X j ) conceal
  222. ;FIXME 50 mountains ( i X j ) conceal
  223.  
  224. ;;; Actions.
  225.  
  226. ;                          i a S r A f b d s m t j X C  z B  G N e O "movers"
  227. (add movers acp-per-turn ( 1 2 2 1 5 9 6 3 3 1 3 3 2 4 12 4 10 2 1 3 ))
  228.  
  229. (add cities acp-per-turn 1)
  230.  
  231. ;;; Movement.
  232.  
  233. (add ( r m ) speed 0)
  234.  
  235. (add cities speed 0)
  236.  
  237. (table mp-to-enter-terrain
  238.   (u* t* 99)
  239.   (ships water 1)    ; sea is pretty straightforward...
  240.   (( s C B ) shallows (2 3 3))    ; big ships don' like shallows
  241.   (ground water 99)
  242.   (( X O ) shallows 3)
  243.   (aircraft t* 1)    ; Aircraft ignore most terrain
  244.   (u* vacuum 99)    ; nothing here can stand vacuum
  245.   (G vacuum 1)    ;  well, missiles can...
  246.   (bases t* 1)    ; bases can go anywhere
  247.   ; movement on terrain...
  248.   (ships land 99)    ; most ships can't go on land too!
  249.   (( d t m ) swamp 3)    ; but swamps are shallow enough for small ones
  250.   ; ground units and land terrain:
  251.   ;Ice... is special.. It's often water covered with ice.
  252.   (ships ice 99)
  253.   (s ice 1)    ; subs can go under ice
  254.   ; ground units ant how they handle terrain:
  255.   ;               i  a e S  j X O  "ground"
  256.   (ground swamp  (1 99 1 1 3 2 3))    ; most ground units don't like swamp
  257.   (ground desert (1 1 1 1 1 1 1))
  258.   (ground plains (1 1 1 1 1 1 1))    ; plains= big highway
  259.   (ground forest (1 2 1 1 2 1 1))    ;Vehicles must navigate/crush way
  260.   (ground mountains (1 99 1 2 99 2 3))    ; most ground units don't like ice
  261.   (ground ice (99 99 1 2 3 2 2))    ; most ground units don't like ice
  262.   ;Other special moves:
  263.   ;-1 t* r moves ; radar can only operate as a passenger
  264.   (r t* 2)    ;  radar techs can take radar anywhere
  265.   (r water 1)    ; except on water...
  266.   (e t* 2)    ;engineers can go anywhere... but vacuum
  267.   (cities land 1)    ; looks strange, but needed to define allowable places
  268.   )
  269.  
  270. (table consumption-per-move add (movers fuel 1))    ; all units take 1 fuel to move
  271. (table consumption-per-move add (( C B O ) fuel 2))    ; big units take more fuel
  272.  
  273. ;100 u* A alter-mobility
  274. ;(table mp-per-occupant add (G N 90))
  275.  
  276. (table mp-to-enter-unit add (aircraft u* 20))    ; aircraft can't sortie again until next turn
  277. (table mp-to-enter-unit add (bases ships 1))
  278. (table mp-to-leave-unit add (bases ships 1))
  279.  
  280. ;FIXME ferry-on-entry is U1 U2 -> FTYPE how much terrain U2 crosses to board U1
  281. (table ferry-on-entry add (u* u* over-all))    ; lets everything attack everywhere
  282. (table ferry-on-entry add (m u* over-all))    ; mines can't attack across terrain
  283. (table ferry-on-entry add (bases i over-all))    ; infantry can capture cities even on water.
  284.  
  285. ;;; Construction.
  286.  
  287. ; big cities produce a tad faster, especially high tech stuff
  288.  
  289. ;                i  a  S  r  A  f  b  d  s  m  t  j  X  C  z  B  G  N  e  O "movers"
  290. (add movers cp ( 5  9 12  9 13 12 15 13 14  4 11  7 16 45 27 60  7 30 14 45 ))
  291.  
  292. (add bases cp ( 4 1 10 15 30 45 ))
  293.  
  294. (table acp-to-create
  295.   (i L 1)
  296.   (ground / 1)
  297.   (O / 0)
  298.   (e bases 1)
  299.   (makers movers 1)
  300.   (V O 0)
  301.   )
  302.  
  303. (table cp-on-creation
  304.   (i L 1)
  305.   ;           i a e S j X O "ground"
  306.   (ground / ( 7 5 8 1 7 8 0))
  307.   (e bases 1)
  308.   (makers movers 1)
  309.   (V O 0)
  310.   ;           i  a  S  r  A  f  b  d  s  m  t  j  X  C  z  B  G  N  e  O "movers"
  311.   (* movers ( 2  3  3  4  4  4  6  3  3  2  2  3  5 16 10 21  2  1  3  1 ))
  312.   (@ movers ( 2  3  4  4  4  5  6  4  4  2  3  3  7 19 16 25  3  3  5  8 )) 
  313.   )
  314.  
  315. (table acp-to-build
  316.   (i L 1)
  317.   (ground / 1)
  318.   (e bases 1)
  319.   (makers movers 1)
  320.   (V O 0)
  321.   )
  322.  
  323. (table cp-per-build
  324.   (i L 1)
  325.   (ground / 1)
  326.   ;          L & / V * @ "bases"
  327.   (e bases ( 2 1 3 1 1 1 ))
  328.   (makers movers 1)
  329.   (V O 0)
  330.   ((* @) N 2)
  331.   )
  332.  
  333. #|  ; leave this out for the moment
  334. (table material-to-build
  335.   (movers people (  4  2  1  0  0  0  0  1  1  0  1  1  2  3  0  3  3  0  3  0 ))
  336.   ; people needed to operate units...
  337.   (L ( ammo fuel people ) ( 3 3 1 ))    ; fortification needs stockpiles!
  338.   (bases people ( 0 0 0 200 400 800 ))    ; bases need to be populated
  339.   )
  340. |#
  341.  
  342. #|
  343. (add u* acp-to-toolup 1)
  344.  
  345. (table tp-per-toolup (u* u* 1))
  346.  
  347. (table tp-to-build
  348.   (u* u* 0)
  349.   ;; on the average, add about 20% build time for toolup
  350.   ;           i  a  S  r  A  f  b  d  s  m  t  j  X  C  z  B  G  N  e  O "movers"
  351.   (V movers ( 1  2  2  2  2  2  3  2  2  1  2  1  3  9  5 12  1  6  3  9 ))
  352.   (* movers ( 1  2  2  2  2  2  3  2  2  1  2  1  3  9  5 12  1  6  3  9 ))
  353.   (@ movers ( 1  2  2  2  2  2  3  2  2  1  2  1  3  9  5 12  1  6  3  9 ))
  354.   )
  355. |#
  356.  
  357. ; does all prod time calcs using integer arith.
  358. ;  i   a   S   r   A   f   b   d  s  m  t  j  X  C   z  B   G   N   e   O
  359. ;FIXME this is handled by tech level and research now...
  360. ;FIXME ( 50 100 160 400 100 120 100  60 88 50 58 50 80 12 100  5 360 375 192 60 ) movers research
  361. ;  template for research-contrib...
  362. ;  it is % of research on first unit(vector) that counts toward unit.
  363. ;() () r research-contrib
  364. ;FIXME ( 234 434 284 ) A ( f b z ) research-contrib
  365. ;FIXME ( 388 634 ) ( b r ) G research-contrib
  366. ;FIXME ( 300 50 100 80 ) ( a X B N ) O research-contrib
  367. ;FIXME ( 100 80 ) ( i X ) S research-contrib
  368. ;FIXME 60 z r research-contrib
  369. ;FIXME ( 60 120 50 50 ) ( f b z G ) A research-contrib
  370. ;FIXME ( 50 90 90 100 ) ( A b z G ) f research-contrib
  371. ;FIXME ( 80 90 60 30  ) ( A f z G ) b research-contrib
  372. ;FIXME ( 20 90 70 90  ) ( A f b G ) z research-contrib
  373. ;FIXME ( 40 40 60 50 50 ) ( s m t C B ) d research-contrib
  374. ;FIXME ( 40 40 10 20 20 ) ( s d t C B ) m research-contrib
  375. ;FIXME ( 20 50 20 60 60 ) ( s d m C B ) t research-contrib
  376. ;FIXME ( 50 10 40 60 10 80 40 ) ( f s d t m B N ) C research-contrib
  377. ;FIXME ( 60 10 80 50 60 10 40 ) ( O s d t C m N ) B research-contrib
  378. ;FIXME ( 50 80 ) ( i a ) j research-contrib
  379. ;FIXME ( 100 80 90 ) ( i a S ) X research-contrib
  380. ;FIXME ( 60 80 60 20 40 40 ) ( b m G O C B ) N research-contrib
  381. ;FIXME ( 80 10 ) ( i X ) e research-contrib
  382.  
  383. ; no special materials to make
  384.  
  385. (table supply-on-completion (bases m* 100))    ; we don't start with any materials
  386.  
  387. ;;; Repair.
  388.  
  389. ;FIXME hp-per-repair is U1 U2 -> .01HP that U1 restores to U2 per repair action
  390. ; ...and you have to add...
  391. ; acp-to-repair is U1 U2 -> ACP to do one repair action
  392. (table acp-to-repair add (( / V * @ ) u* 1))
  393. (table acp-to-repair add (( L & e ) u* 1))
  394. (table acp-to-repair add (( C B O ) ( C B O ) 1))
  395. (table acp-to-repair add (i bases 1))
  396. (table acp-to-repair add (e u* 1))
  397. (table acp-to-repair add (i ( L & / V ) 1))
  398.  
  399. (table hp-per-repair add (( / V * @ ) u* 100))
  400. (table hp-per-repair add (( L & e ) u* 50))
  401. (table hp-per-repair add (( C B O ) ( C B O ) 12))
  402. (table hp-per-repair add (i bases 20))
  403. (table hp-per-repair add (e u* 100))
  404. (table hp-per-repair add (i ( L & / V ) ( 100 50 100 25 )))
  405.  
  406. ;;; Production.
  407.  
  408. ;;; Combat.
  409.  
  410. ;                i a S r A f b d s m t j X C z B G N e  O L &  /  V  *  @
  411. (add u* hp-max ( 1 2 2 1 2 1 3 3 2 1 3 1 3 4 1 8 1 1 1 12 3 2 10 12 20 40 ))
  412.  
  413. ;FIXME in addition you can set hp-to-repair and other things to cripple a unit
  414. ;(add u* hp-at-min-speed ( 0 1 0 0 1 0 1 1 1 0 1 0 1 1 0 3 0 0 0  4  1  2  6  8 10 20 ))
  415. ; crippled is < test, not <=
  416.  
  417. ; split the matrix in half to reduce the number of entries per line
  418. (define u1 ( i  a  S  r  A  f  b  d  s  m  t  j  X ))
  419. (define u2 ( C  z  B  G  N  e  O  L  &  /  V  *  @ ))
  420.  
  421. (table hit-chance
  422.   ;         i   a   S   r   A   f   b  d  s  m  t  j  X "u1"
  423.   (i u1 (  50  40  35  90  30  20  25 20 20 30 30 80 30 ))
  424.   (a u1 (  60  50  50  85  35  25  25 25 25 25 35 85 45 ))
  425.   (S u1 (  65  60  50  90  10   7   9 10 12 15 20 80 35 ))
  426.   (r u* 0)    ; radar don't hit anything
  427.   (A u* 0)    ; Transport plane isn't armed!
  428.   (f u1 (  25  20  15  80  80  60  70 45 50 35 45 75 35 ))
  429.   (b u1 (  20  30  15  80  30  10   9 55 50 35 60 70 40 ))
  430.   (d u1 (   7   9   6  80  20  15  17 50 60 80 75 40 25 ))
  431.   (s u1 (   9  10   7  80  30  10  10 50 50 60 75 20  6 ))
  432.   (m u* 0)
  433.   (m ships ( 40 50 80 70 75 75 ))
  434.   (t u1 (   4   3   3  80  10  10  10 40 30 50 45 20  2 ))
  435.   (j u1 (   1   0   5  80  00  00   0  0  0  0  0 50  0 ))
  436.   (X u1 (  65  70  50  80  30  35  32 40 40 50 50 90 45 ))
  437.   (C u1 (  30  20  15  80  60  50  55 40 40 30 55 30 15 ))
  438.   ; z
  439.   (B u1 (  50  50  45  80  55  40  45 65 60 40 70 80 40 ))
  440.   (G u* 150)    ; missiles hit everything, modifiers ineffective
  441.   (N u* 200)    ; nukes hit everything, modifiers ineffective
  442.   (e u1 (   5   4   3  70  10   9  10 10 12 15  9 40  3 ))
  443.   (O u1 (  80  70  65  90  60  40  35 60 80 40 60 90 60 ))
  444.   (L u1 (  40  50  25  90  60  30  30 40 40 30 40 90 35 ))
  445.   (& u* 0)    ; bridges aren't armed!
  446.   (/ u1 (  10  10  15  80  60  20  20 20 20 20 20 50  7 ))
  447.   (V u1 (  25  15  30  80  70  45  35 25 20 20 30 80 12 ))
  448.   (* u1 (  30  20  35  80  85  50  40 40 20 20 45 80 20 ))
  449.   (@ u1 (  50  40  55  80  95  70  60 50 20 20 55 80 30 ))
  450.   ; second half of matrix
  451.   ;        C   z   B   G   N   e   O   L  &  /   V   *   @ "u2"
  452.   (X u2 ( 65  70  50  80  30  35  32  40 40  50 50  90  45 ))
  453.   (O u2 ( 80  20  65  90  60  60  45  80 85 80  70  65  60 ))
  454.   (i u2 ( 20   1   9  40  40  50  10  60 40 80  70  60  40 ))
  455.   (a u2 ( 20   1  20  50  50  60  30  40 50 90  80  70  50 ))
  456.   (S u2 (  1   3   4   4  30  30  20  40 70 55  40  30  20 ))
  457.   (A u2 (  5   3   0   0   0   0   3   1 10  5  10  25  30 ))
  458.   (f u2 ( 50  50  40  80  80  65  30  48 60 70  80  80  80 ))
  459.   (b u2 ( 70  10  60  50  50  20  40  70 60 90  90  90  94 ))
  460.   (d u2 ( 40   1  20   0   0   5  10  15 50 99  90  90  80 ))
  461.   (s u2 ( 40   1  50   0   0   0  10   0  6  0   0   0   0 ))
  462.   ; m
  463.   (t u2 ( 30   1   9   0   0  20   8   4 30  0   0   0   0 ))
  464.   (j u2 (  1   0   5  80  00  00   0   0  0  0   0  50   0 ))
  465.   ; X
  466.   (C u2 ( 20  10  20   8   8  30   7   0  0  0   0   0   0 ))
  467.   (B u2 ( 50  10  90   0   0  50  40  70 89 99  99  99  99 ))
  468.   ; G
  469.   ; N
  470.   (e u2 (  0   1   3  20  21  30   8  80 70 80  70  60  40 ))
  471.   (L u2 ( 20   5   9  40  40  50  60   0  0  0   0   0   0 ))
  472.   (/ u2 ( 20  20  20   0   0  10  30   0  0  0   0   0   0 ))
  473.   (V u2 ( 20  20  20   0   0  25  30   0  0  0   0   0   0 ))
  474.   (* u2 ( 20  30  20   0   0  30  35   0  0  0   0   0   0 ))
  475.   (@ u2 ( 20  40  50   0   0  50  40   0  0  0   0   0   0 ))
  476.   ;; Missiles and nukes never survive their attack.
  477.   (u* ( G N ) 100)
  478.   )
  479.  
  480. (table defend-terrain-effect 
  481.   (i ( forest swamp mountains ) 90)
  482.   )
  483.  
  484. (table damage
  485.   (u* u* 1)
  486.   (a cities 2)
  487.   (a ( a X O ) 2)
  488.   (S bases 2)
  489.   (b ships 2)
  490.   (b s 1)
  491.   (b ( / V * ) 2)
  492.   (b @ 3)
  493.   (b ground 2)
  494.   (d s 2)
  495.   (( s m ) ships 3)
  496.   (B u* 2)
  497.   (O u* 3)
  498.   (O bases 4)
  499.   (B ( V * @ ) ( 3 3 4 ))
  500.   (G u* 4)
  501.   (G ( V * @ ) ( 5 5 6 ))
  502.   (N u* 60)
  503.   (X u* 2)
  504.   )
  505.  
  506. ;FIXME true capturemoves
  507.  
  508. ;FIXME true counterattack
  509.  
  510. (table acp-to-defend add (( G N m ) u* false))
  511.  
  512. (table capture-chance
  513.   (S ( A b s t j C B N ) ( 20 15 15 26 22 4 4 18 ))    ; elite special missions
  514.   (i ( b t j C B ) ( 00 10 15 3 3 ))    ; board and capture!
  515.   ;           L  &  /  V  *  @ "bases"
  516.   (S bases ( 10 70 60 30 20 10 ))
  517.   (i bases (  5 30 70 55 50 30 ))
  518.   (a bases (  6 40 90 75 70 50 ))
  519.   (X bases (  8 90 90 75 70 60 ))
  520.   )
  521.  
  522. (add ( G N m ) acp-to-detonate 1)
  523.  
  524. (table protection
  525.   (cities movers 50)    ; cities offer some protection to occupants
  526.   (a cities 90)    ; armor protect the cities housing them.
  527.   ; can't make this too large or city can be
  528.   ; invulnerable.
  529.   (i cities 95)    ; same for infantry.
  530.   (a / 75)
  531.   (i / 85)
  532.   (L ( i a ) (75 90))
  533.   )
  534. ; ???
  535. (table protection add (bases ground 99))
  536. (table protection add (L ( e i A X O S ) 98))
  537.  
  538. ;FIXME U1 U2 -> % that U2 withdraws before U1 attacks
  539. (table withdraw-chance-per-attack add (u* ground 10))
  540. (table withdraw-chance-per-attack add (u* O 0))    ; ogres don't retreat!
  541. (table withdraw-chance-per-attack add (u* ships 5))
  542. (table withdraw-chance-per-attack add (u* aircraft 25))
  543.  
  544. (table consumption-per-attack add (u* ammo 1))
  545.  
  546. (table hit-by (u* ammo 1))
  547.  
  548. ;FIXME "destroys" ground destroy-message
  549. ;FIXME "sinks" ships destroy-message
  550. ;FIXME "shoots down" aircraft destroy-message
  551. ;FIXME "devastates" cities destroy-message
  552.  
  553. ;100 u* max-quality ;  what's the range of this?
  554. ;100 u* veteran ;  what's the range of this?
  555. ;100 u* max-morale ;  what's the range of this?
  556. ;FIXME true u* neutral    ;everything can become neutral
  557.  
  558. ;;; Other actions.
  559.  
  560. (add u* acp-to-change-side 1)    ; equipment is indifferent to its fate
  561. (add ( i a e X O S ) acp-to-change-side 0)    ; but armies have some loyalty
  562. ; Should N, e change sides? (gives away research)
  563.  
  564. ;FIXME true u* neutral
  565. ;FIXME false i neutral
  566.  
  567. (add movers acp-to-disband 1)
  568. (add ( L & / V ) acp-to-disband 1)
  569.  
  570. (add movers hp-per-disband 99)
  571. (add ( L & / V ) hp-per-disband 99)
  572.  
  573. ;100 u* efficiency ; so you can reclaim materials used to make disbanded units
  574. ; (should calc from to-build etc)
  575.  
  576. ;;; Backdrop economy.
  577.  
  578. (table base-production
  579.   (( i S m ) fuel ( 2 2 1 ))
  580.   (N fuel 20)    ; nuclear plant powers things
  581.   (e ( fuel ammo ) ( 2 1 ))
  582.   ;                L  &  /  V  *  @ "bases"
  583.   (bases fuel   (  4  1 10 15 20 50 ))
  584.   (bases ammo   (  0  1  5  8 10 20 ))
  585.   (bases people (  0  0  0  2  4  8 ))
  586.   )
  587.  
  588. ; terrain effects on material production
  589. (table productivity
  590.   (u* t* 100)    ;the default anyway!
  591.   (i ( sea desert mountains ice ) 0)
  592. ;  (land sea 0)
  593. ;  (land shallows 0)
  594.   (i shallows 50)
  595.   (a plains 100)    ; in this case "plains" = "gas stations"
  596.   ; plains/forest/desert/mountains
  597.   (L land ( 100 90 70 50 ))    ; one arg must be a scalar...
  598.   (/ land ( 100 90 70 50 ))
  599.   (V land ( 100 90 70 50 ))
  600.   (* land ( 100 90 70 50 ))
  601.   (@ land ( 100 90 70 50 ))
  602.   (bases water 100)    ; Cities in water have improved transport!
  603.   (m water 100)
  604.   (N t* 100)    ; Nuke power is independant!
  605.   (cities t* 100)
  606.   )
  607.  
  608. (table base-consumption 
  609.   (movers fuel 1)    ; all consume 1 fuel, except...
  610.   (L ammo 2)
  611.   (( r m ) fuel 0)  ; these just sit quietly
  612.   (i fuel 1)
  613.   (aircraft fuel 2)    ; aircraft need lotsa fuel to stay aloft
  614.   )
  615.  
  616. ; consume-as-occupant is strange.  1 means they don't consume!
  617. (table consumption-as-occupant add (u* m* 1))
  618. (table consumption-as-occupant add (( r X S C B O ) m* 0))
  619. (table consumption-as-occupant add (aircraft m* 1))
  620. (table consumption-as-occupant add (( a m j O N ) m* 1))
  621.  
  622. ; inlength is how far away a unit can receive fuel from
  623. ; out-length is how far away a unit can deliver fuel.  Should be kept
  624. ; small, as it can waste much CPU time
  625.  
  626. (table out-length
  627.   (u* m* 0)
  628.   (bases m* 4)
  629.   (bases people 2)    ;  they will look for nearby places to expand
  630.   ; bases form good supply lines, so do transport units and big ships
  631.   (( A t j C B L & / V * @ ) fuel ( 1 1 1 1 1 2 1 2 2 3 4 ))
  632.   (( A t j C B L & / V * @ ) ammo ( 1 1 1 1 1 2 1 2 2 3 4 ))
  633.   )
  634.  
  635. (table in-length
  636.   (u* fuel 1)    ;  all units can be resupplied by adjacent units
  637.   (u* ammo 1)
  638.   (u* people -1)    ; People don't really want to migrate in war
  639.   (bases people 4)    ; except to cities, of course.
  640.   (e m* 2)    ;  They follow the engineers for jobs!
  641.   (aircraft fuel 0)    ; no mid-air refueling yet.  can't make it selective
  642.   (( L & / V * @ ) fuel ( 2 2 3 4 4 4 ))
  643.   (( L & / V * @ ) ammo ( 2 2 3 4 4 4 ))
  644.   )
  645.  
  646. ;;; Random events.
  647.  
  648. ; accidents
  649. ;FIXME surrender is U1 U2 -> .01N chance that U1 surrenders to U2
  650. ; and surrender-range is distance at which it can occur
  651. ;(table surrender-chance add (( V * @ ) u* ( 6 3 1 )))
  652. ;( 60 50 30 ) ( V * @ ) siege
  653. ;FIXME 190 bases siege    ; They have too much supply needs to withstand siege for long
  654.  
  655.  
  656. ;FIXME attrition is U T -> .01HP (rate of loss, hp/turn)
  657. (table attrition add (s ( sea shallows ice ) ( 1 5 8 )))    ; chance of attrition for the unit
  658. (table attrition add (t ( sea shallows ice ) ( 1 5 8 )))    ; chance of attrition for the unit
  659. ;FIXME "disabled at sea" ( s t ) attrition-message
  660.  
  661.  
  662. (table attrition add (( C B ) shallows 10))
  663. ;FIXME "runs aground" ( C B ) attrition-message
  664. ;FIXME accident is U T -> .01N chance that an accident happens to U
  665. ; and you can set accident-damage
  666. (table accident-hit-chance add (( A f b ) mountains ( 9 4 5 )))    ; flyers running into mountains
  667. ;FIXME "Crashes in the mountains" ( A f b ) accident-message
  668. (table accident-hit-chance add (( A f b ) mountains ( 9 4 5 )))    ; flyers running into mountains
  669. ;FIXME "Crashes in the mountains" ( A f b ) accident-message
  670. (table accident-hit-chance add (m water 2))    ; mines disappearing at sea
  671. ;FIXME "Drifts away" m accident-message
  672. (table attrition add (O shallows 10))
  673. ;FIXME "Gets stuck in mud" O attrition-message
  674.  
  675. ;FIXME spy-chance is now on a per unit basis...
  676. ; and spy-range specifies how far a unit can spy
  677. (add u* spy-chance false)    ; we don't spontaneously see all the enemies
  678. ;FIXME spy-quality is U1 U2 -> % that U1 returns info about U2
  679. (table spy-quality (u* u* false))    ; and we don't see any of them if we do!
  680.  
  681. ;FIXME I guess nuked is damaged-terrain now, T1 T2 -> N
  682. ;FIXME t* t* nuked    ; most terrain won't actually change
  683. ;FIXME desert ( plains forest ) nuked
  684. ;FIXME mountains ice nuked
  685. ;FIXME swamp shallows nuked
  686.  
  687. ;;; Scoring.
  688.  
  689. (scorekeeper (do last-side-wins))
  690.  
  691. (add ( & / V * @ ) point-value ( 1 2 8 10 50 ))    ;  territory values for victory pts.
  692.  
  693. ;;; Random setup.
  694.  
  695. (set synthesis-methods
  696.   '(make-fractal-percentile-terrain make-countries make-independent-units
  697.     make-initial-materials name-units-randomly))
  698.  
  699. ; storm with alt:0-33 wet:50-100 seemed a bit too much
  700. (add t* alt-percentile-min (   0  68  69  70  70  70  93  99  0 ))
  701. (add t* alt-percentile-max (  68  69  71  93  93  93  99 100  0 ))
  702. (add t* wet-percentile-min (   0   0  50   0  20  80   0   0  0 ))
  703. (add t* wet-percentile-max ( 100 100 100  20  80 100 100 100  0 ))
  704. ;FIXME this is broken into alt-blob-size, etc. etc.
  705. ;FIXME 60 alt-roughness    ; 0-100  the higher this is, the more altitude roughness
  706. ;FIXME this is broken into wet-blob-size, etc. etc.
  707. ;FIXME 70 wet-roughness    ; Similar to alt-roughness
  708.  
  709. (set edge-terrain ice)
  710.  
  711. (set country-radius-min 8)    ;  the radius of a 'country'
  712. (set country-separation-min 10)    ;  the closest a country may be
  713. (set country-separation-max 60)    ;  the furthest apart a country may be.
  714.  
  715. (add ( V * @ ) start-with ( 1 2 1 ))    ; units player starts with
  716.  
  717. (table independent-density (( @ * V ) land ( 35 80 60 )))
  718.  
  719. (table favored-terrain
  720.   (u* t* 0)
  721.   (( V * @ ) land 20)
  722.   (( V * @ ) plains 40)
  723.   (e t* 10)    ; engineers can go anywhere!
  724.   (@ plains 100)
  725.   )
  726.  
  727. (add u* initial-seen-radius 7)
  728.  
  729. (include "nat-names")
  730.  
  731. (add cities namer "random-town-names")
  732.  
  733. (include "town-names")
  734.  
  735. ; should add naming for C and B
  736.  
  737. ;;; Documentation.
  738.  
  739. (game-module (instructions (
  740.   )))
  741.  
  742. (game-module (notes (
  743.   )))
  744.  
  745. (game-module (design-notes (
  746.   )))
  747.  
  748. ; Hand this to a Lisp system, use for calculations...
  749. ; (defun res (res prod)
  750. ;    (setq res (- res (floor (* prod .2))))
  751. ;    (ceiling (* (/ res (floor (* prod 1.2))) 100)))
  752.  
  753. ; (defun restime (prod res) (floor (/ (* (floor (* prod 1.2)) (+ res 100)) 100)))
  754.